package cc.eddic.pratice.programmingparadigms.exam.domain;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

@Getter
public class Exam {
    public Exam(String name) {
        this.name = name;
        questions = new ArrayList<>();
        students = new ArrayList<>();
    }

    public Exam add(Question question, int no) {
        questions.add(new ExamQuestions(no, this, question));
        return this;
    }

    public Exam add(Student student) {
        students.add(new ExamStudents(this, student));
        return this;
    }

    private final String name;
    private final List<ExamQuestions> questions;
    private final List<ExamStudents> students;
}
